package com.zaydanwu.cla.controller.students;

import com.zaydanwu.cla.model.Course;
import com.zaydanwu.cla.model.result.ApiResult;
import com.zaydanwu.cla.service.CourseService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @BelongsProject: cla
 * @BelongsPackage: com.zaydanwu.cla.controller.students
 * @Author: zaydanwu
 * @CreateTime: 2018-12-10 22:39
 * @Description:
 */
@RestController
@RequestMapping("/cla/api")
public class CourseController {

    @Resource
    private CourseService courseService;

    @RequestMapping("/getCourseByTearcherName")
    public ApiResult<Course> getCourseByTearcherName(@RequestParam String teacherName) {
        Course courseByTearcherName = courseService.getCourseByTearcherName(teacherName);
        return ApiResult.success(courseByTearcherName);
    }
}
